/**
 * form内容练习
 */
var React = require('react');
var Form = React.createClass({
    getInitialState: function () {
        return {
            value: ''
        }
    },
    submit: function (e) {
        e.preventDefault();
        alert(this.state.value);
    },
    change: function (e) {
        this.setState({
            value: e.target.value
        });
    },
    render: function () {
        return <form action="" onSubmit={this.submit}>
            <label htmlFor="name">姓名:</label>
            <input type="text" id="name" value={this.state.value} onChange={this.change} autoFocus="true"/>
        </form>
    }
});
module.exports = Form;